﻿/* Write a program that converts a string to a sequence of C# Unicode character literals. 
 * Use format strings. Sample input:
Hi!
Expected output:
\u0048\u0069\u0021 */
using System;

namespace _10.ConvertToUnicode
{
    class ConvertToUnicode
    {
        static void Main()
        {
            Console.WriteLine("Enter a string to convert to unicode char code representation on-the-fly: ");
            string text = Console.ReadLine();
            //string text = "Hi!";
            string converted = null;
            foreach (char ch in text)
            {
                converted += string.Format("\\u{0:x4}", (int)ch);
            }
            Console.WriteLine("Converted string: ");
            Console.WriteLine(converted);
        }
    }
}
